package com.smedi.ismedi.inmail.api.feign;

import com.smedi.ismedi.inmail.api.dto.request.*;
import com.smedi.ismedi.inmail.api.dto.response.*;
import com.smedi.ismedi.web.starter.common.PaginationData;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @Author: niuyanling
 * @Date: 2021-10-22 10:11
 */
@Validated
@RestController
@FeignClient("ismedi-inmail")
@Api(tags = "安全统计接口")
@RequestMapping("api/v1/overview")
public interface RemoteOverviewFeignApi {
    /**
     * 项目统计
     *
     * @return ResponseData<ProjectStatisticsByRegionResponse>
     */
    @ApiOperation(httpMethod = "POST", value = "项目统计")
    @PostMapping(value = "/project")
    ResponseData<ProjectOverviewPaginationData> getProjectOverviewPage(@Validated @RequestBody ProjectOverviewPageRequest projectOverviewPageRequest);

    /**
     * 项目统计导出
     *
     * @return signKey
     */
    @ApiOperation(httpMethod = "POST", value = "项目统计导出")
    @PostMapping(value = "/project/export")
    ResponseData<String> exportProjectOverview(@Validated @RequestBody ProjectOverviewListRequest projectOverviewListRequest);

    /**
     * 安全检查（主体院）统计
     *
     * @return ResponseData<PaginationData<SafetyCheckOverviewResponse>>
     */
    @ApiOperation(httpMethod = "POST", value = "安全检查统计（主体院）")
    @PostMapping(value = "/safety-check/organization")
    ResponseData<SafetyCheckOrgOverviewPaginationData> getSafetyCheckOrganizationOverviewPage(@Validated @RequestBody SafetyCheckOrganizationOverviewPageRequest safetyCheckOrganizationOverviewPageRequest);

    /**
     * 安全检查（主体院）统计导出
     *
     * @return url
     */
    @ApiOperation(httpMethod = "POST", value = "安全检查统计（主体院）导出")
    @PostMapping(value = "/safety-check/organization/export")
    ResponseData<String> exportSafetyCheckOrganizationOverview(@Validated @RequestBody SafetyCheckOrganizationOverviewListRequest safetyCheckOrganizationOverviewListRequest);
    
    /**
     * 安全检查（项目）统计
     *
     * @return ResponseData<PaginationData<SafetyCheckOverviewResponse>>
     */
    @ApiOperation(httpMethod = "POST", value = "安全检查统计（项目）")
    @PostMapping(value = "/safety-check/project")
    ResponseData<PaginationData<SafetyCheckProjectOverviewResponse>> getSafetyCheckProjectOverviewPage(@Validated @RequestBody SafetyCheckProjectOverviewPageRequest safetyCheckProjectOverviewPageRequest);

    /**
     * 安全检查（项目）统计导出
     *
     * @return url
     */
    @ApiOperation(httpMethod = "POST", value = "安全检查统计（项目）导出")
    @PostMapping(value = "/safety-check/project/export")
    ResponseData<String> exportSafetyCheckProjectOverview(@Validated @RequestBody SafetyCheckProjectOverviewListRequest safetyCheckProjectOverviewListRequest);

    /**
     * 人员考勤统计
     *
     * @return ResponseData<PaginationData<AttendanceOverviewResponse>>
     */
    @ApiOperation(httpMethod = "POST", value = "人员考勤统计")
    @PostMapping(value = "/attendance")
    ResponseData<PaginationData<AttendanceOverviewResponse>> getAttendanceOverviewPage(@Validated @RequestBody AttendanceOverviewPageRequest attendanceOverviewPageRequest);

    /**
     * 项目级别统计
     *
     * @return ResponseData<PaginationData<ProjectPersonOverViewResponse>>
     * */
    @ApiOperation(httpMethod = "POST", value = "项目级别统计 主体院")
    @PostMapping(value = "/project/level")
    ResponseData<PaginationData<ProjectPersonOverViewResponse>> projectLevelOverviewPage(@Validated @RequestBody ProjectOverviewPageRequest projectOverviewPageRequest);

    /**
     * 项目级别统计
     *
     * @return ResponseData<PaginationData<ProjectPersonOverViewResponse>>
     * */
    @ApiOperation(httpMethod = "POST", value = "岗位人员统计 项目")
    @PostMapping(value = "/project/job")
    ResponseData<PaginationData<ProjectPostOverViewResponse>> projectPostOverviewPage(@Validated @RequestBody ProjectOverviewPageRequest projectOverviewPageRequest);

    /**
     * 项目级别统计 岗位人员列表 弹窗
     * */
    @ApiOperation(httpMethod = "GET", value = "岗位人员列表 弹窗 项目")
    @GetMapping(value = "/project/job/list")
    ResponseData<List<ProjectJobPersonResponse>> projectJobPersonList(@RequestParam Long projectId , @RequestParam String projectJob);

    /**
     * 项目级别统计 岗位人员查看列表 查看
     * */
    @ApiOperation(httpMethod = "GET", value = "岗位人员 查看 项目")
    @GetMapping(value = "/project/job/person")
    ResponseData<ProjectPostPersonOverViewResponse> projectPostPersonList(@RequestParam Long projectId);

    /**
     * 人员考勤统计导出
     *
     * @return url
     */
    @ApiOperation(httpMethod = "POST", value = "人员考勤统计导出")
    @PostMapping(value = "/attendance/export")
    ResponseData<String> exportAttendanceOverview(@Validated @RequestBody AttendanceOverviewListRequest attendanceOverviewListRequest);

    /**
     * 视频监控统计
     *
     * @return ResponseData<PaginationData<VideoMonitorOverviewResponse>>
     */
    @ApiOperation(httpMethod = "POST", value = "视频监控(主体院)统计")
    @PostMapping(value = "/video-monitor/organization")
    ResponseData<VideoMonitorOrgOverviewPaginationData> getVideoMonitorOrganizationOverviewPage(@Validated @RequestBody VideoMonitorOrganizationOverviewPageRequest videoMonitorOrganizationOverviewPageRequest);

    /**
     * 视频监控统计导出
     *
     * @return url
     */
    @ApiOperation(httpMethod = "POST", value = "视频监控(主体院)统计导出")
    @PostMapping(value = "/video-monitor/organization/export")
    ResponseData<String> exportVideoMonitorOrganizationOverview(@Validated @RequestBody VideoMonitorOrganizationOverviewListRequest videoMonitorOrganizationOverviewListRequest);

    /**
     * 视频监控统计
     *
     * @return ResponseData<PaginationData<VideoMonitorOverviewResponse>>
     */
    @ApiOperation(httpMethod = "POST", value = "视频监控(项目)统计")
    @PostMapping(value = "/video-monitor/project")
    ResponseData<PaginationData<VideoMonitorProjectOverviewResponse>> getVideoMonitorProjectOverviewPage(@Validated @RequestBody VideoMonitorProjectOverviewPageRequest videoMonitorProjectOverviewPageRequest);

    /**
     * 视频监控统计导出
     *
     * @return url
     */
    @ApiOperation(httpMethod = "POST", value = "视频监控(项目)统计导出")
    @PostMapping(value = "/video-monitor/project/export")
    ResponseData<String> exportVideoMonitorProjectOverview(@Validated @RequestBody VideoMonitorProjectOverviewListRequest videoMonitorProjectOverviewListRequest);

    /**
     * 钉钉相关数据更新
     *
     * @return ResponseData<Boolean>
     */
    @ApiOperation(httpMethod = "POST", value = "钉钉打卡记录更新")
    @PostMapping(value = "/ding-talk/data/update")
    ResponseData<Boolean> updateDingTalkData();

    /**
     * 钉钉相关数据更新
     *
     * @return ResponseData<Boolean>
     */
    @ApiOperation(httpMethod = "POST", value = "钉钉人员信息相关数据更新")
    @PostMapping(value = "/ding-talk/data/update/person")
    ResponseData<Boolean> updateDingTalkPerson();

    /**
     * 主体院考勤信息
     * */
    @ApiOperation(httpMethod = "POST" ,value = "主体院钉钉考勤统计")
    @PostMapping(value = "/ding-attendance/org/page")
    ResponseData<PaginationData<DingAttendanceOverViewResponse>> getDingAttendancePaginationDataResponseData(@Validated @RequestBody DingAttendanceOverViewPageRequest dingAttendanceOverViewPageRequest);

    /**
     * 项目考勤信息
     * */
    @ApiOperation(httpMethod = "POST",value = "项目钉钉考勤统计")
    @PostMapping(value = "/ding-attendance/project/page")
    ResponseData<PaginationData<DingAttendanceProjectOverViewResponse>> getDingAttendanceProjectPaginationDataResponseData(@Validated @RequestBody DingAttendanceProjectOverViewPageRequest dingAttendanceProjectOverViewPageRequest);

    /**
     * 单个项目考勤信息详情
     * */
    @ApiOperation(httpMethod = "POST",value = "项目钉钉考勤详情")
    @PostMapping(value = "/ding-attendance/project")
    ResponseData<DingDingAttendanceProjectResponse> getProjectDetail(@Validated @RequestBody DingDingProjectRequest dingDingProjectRequest);

    /**
     * 主体院考勤信息导出
     * */
    @ApiOperation(httpMethod = "POST",value = "主体院钉钉考勤信息导出")
    @PostMapping(value = "/ding-attendance/org/export")
    ResponseData<String> exportOrgAttendance(@RequestBody DingAttendanceOrgExportRequest request);

    /**
     * 项目钉钉考勤信息导出
     * */
    @ApiOperation(httpMethod = "POST",value = "项目钉钉考勤信息导出")
    @PostMapping(value = "/ding-attendance/project/export")
    ResponseData<String> exportProjectAttendance(@RequestBody DingAttendanceProjectExportRequest request);

    /**
     * 不合格项目详情
     * */
    @ApiOperation(httpMethod = "POST", value = "不合格项目详情")
    @PostMapping(value = "/ding-attendance/project/detail/page")
    ResponseData<PaginationData<DingDingAttendanceProjectDetailResponse>> projectDetailPage(@Validated @RequestBody DingProjectDetailPageRequest request);

    /**
     * 不合格人员详情
     * */
    @ApiOperation(httpMethod = "POST", value = "不合格人员详情")
    @PostMapping(value = "/ding-attendance/people/detail/page")
    ResponseData<PaginationData<DingDingAttendancePeopleDetailResponse>> peopleDetailPage(@Validated @RequestBody DingProjectDetailPageRequest request);

    /**
     * 人员是否与钉钉关联
     * */
    @ApiOperation(httpMethod = "GET", value = "人员是否与钉钉关联")
    @GetMapping(value = "/ding-attendance/exist")
    ResponseData<Boolean> peopleExist(@Validated @RequestParam Long personId);

    /**
     * 钉钉关联人员
     * */
    @ApiOperation(httpMethod = "GET", value = "钉钉关联人员")
    @GetMapping(value = "/ding-attendance/{projectId}")
    ResponseData<List<String>> peopleByProjectId(@PathVariable Long projectId);
}
